package com.cyy.demo.test.designpattern;

import java.util.ArrayList;
import java.util.List;

public class Watch {


}

class Watcher{

    public void login(){

    }

}

class Watched{

    private List<Watcher> list = new ArrayList<Watcher>();


    int count = 0;
    public void login(){
        count++;
        System.out.println("登陆一人:"+count);
    }

    public void logout(){
        count--;
        System.out.println("登出一人:"+count);
    }

    public void notifyWathed(){
        System.out.println(count);
    }

}
